Open
Conversation
2a86ec9 to
621a8a7
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub Copilot SDK adapter to use specific Copilot SDK import paths for tool discovery and permission/config types.
Changes:
- Switch
Toolimport tofrom copilot.tools import Toolin tool discovery. - Switch
PermissionRequestResult/ProviderConfigimports tofrom copilot.session import ...and remove the runtime fallback behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| sdk/agentserver/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_tool_discovery.py | Uses a single Copilot SDK import path for Tool. |
| sdk/agentserver/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_copilot_adapter.py | Uses a single Copilot SDK import path for permission/config types and removes fallback object construction. |
...ver/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_tool_discovery.py
Show resolved
Hide resolved
...er/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_copilot_adapter.py
Outdated
Show resolved
Hide resolved
...er/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_copilot_adapter.py
Show resolved
Hide resolved
...ver/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_tool_discovery.py
Show resolved
Hide resolved
jodeklotzms
approved these changes
Apr 3, 2026
Member
jodeklotzms
left a comment
There was a problem hiding this comment.
I'm good with this. I assume you've tested this more than I have!
Member
|
The change looks straightfoward to me, but here's my context agent's review: |
69bc19e to
9c6f6dd
Compare
Major architecture change: FoundryCBAgent (inheritance) → AgentHost +
ResponseHandler (composition). Hypercorn replaces uvicorn.
Fixes:
- SSE streaming truncation (correct RAPI event ordering works natively)
- Duplicate text in streaming (only emit ASSISTANT_MESSAGE_DELTA)
- Eliminates heartbeat hack (built-in SSE keepalive)
Deleted:
- _copilot_response_converter.py (355 lines) — replaced by ResponseEventStream builders
- _copilot_request_converter.py (313 lines) — replaced by get_input_text()
- Unit tests for deleted converter
Preserved:
- Public API: GitHubCopilotAdapter.from_project(".").run()
- All env vars unchanged
- BYOK auth, model discovery, Tool ACL, skill/tool discovery
- Conversation history bootstrap (now uses own AsyncOpenAI client)
Dependencies:
- azure-ai-agentserver-core>=2.0.0a1 (was >=1.0.0b14,<1.0.0b18)
- azure-ai-agentserver-responses>=1.0.0a1 (new)
- Removed opentelemetry-exporter-otlp-proto-http (tracing via core[tracing])
Validated on ADC as trove-replat-v4 with correct streaming.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The ResponseHandler expects the create_handler to be an async generator (with __anext__), not a coroutine. Fixed by using async for delegation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Azure DevOps feed is public — pip just needs --no-input to suppress the interactive auth prompt in non-interactive builds (like ACR Tasks). Removes wheel download/copy from deploy script and Dockerfile. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Azure DevOps feed proxies github-copilot-sdk but requires auth for upstream packages it hasn't cached. Fix: install base packages from dev feed in a separate pip call, then install our package + deps from PyPI only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix duplicate kwargs bug: remove explicit skill_directories/tools from create_session() calls — already present in sdk_config via _session_config - Bump version to 1.0.0b2 to match CHANGELOG - Remove .foundry-agent.json (contained real session/conversation IDs) - Close AsyncDefaultCredential in _load_conversation_history to prevent async transport/socket leak - Restore attachment handling: _extract_input_with_attachments() extracts input_file and input_image items from RAPI requests and appends to prompt - Observe cancellation_signal in event loop to stop early on client disconnect - Drop [tracing] extra from test Dockerfile to match pyproject.toml deps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…issing The ResponseHandler context only populates conversation_id when the request includes an explicit "conversation" field. Most callers (invoke scripts, Playground) only send session_id. Without this fallback, conversation_id is always None and the adapter creates a fresh Copilot SDK session on every request, breaking multi-turn. Also fixes Windows --no-logs in integration test deploy script. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
conversation_id is only set when the request includes an explicit "conversation" field. Most callers (invoke scripts, Playground) only send session_id. The adapter now falls back to context.raw_body ["session_id"] and sets it on context.conversation_id so session reuse and history bootstrap work transparently. Also adds build tag canary for deployment verification. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ound The Playground sends conversation identity via raw_body['conversation']['id'] (from Chat Completions API translation), not session_id. The fallback now checks both session_id and conversation.id in the raw body. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Covers input extraction with attachments, conversation_id fallback (session_id and conversation.id from raw_body), session config building, BYOK URL derivation, project endpoint resolution, and skill directory discovery. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9c6f6dd to
fbe4de1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines